<?php
	class memberControl extends commonControl{
	//显示主页面；	
		function index(){
			$db = M("user");
			$infor = $db->findall();
			$nums = $db -> field("uid") ->count();
			$page = new page($nums,5);
			$result = $db ->limit($page->limit())->order("uid desc")->all();
			$this->assign("result",$result);
			$this->assign("page",$page->show(2));
			$this->display();
		}
	//显示添加会员界面；
		function add_show(){
			$ip = ip_get_client();
			$this->assign("ip",$ip);
			$time = time();
			$this->assign("time",$time);
			$this->display();
		}
	//添加会员；
		function add(){
			$db = M("user");
			$_POST["password"] = md5($_POST["password"]);
			if($db->add()){
				$this->success("用户注册成功","index");
			}else{
				$this->error("用户注册失败","index");
			}
		}
	//删除多个已选中的文件；
		function del_sel_all(){
			$db = M("user");
			$nums = array_keys($_POST['del']);
			if($db -> del($nums)){
				$this->success("删除成功","index");
			}else{
				$this->error("删除失败","index");
			}
		}
	}
?>